A port-channel architecture, such as EtherChannel, aggregates multiple physical Ethernet links into one logical Ethernet link to provide increased bandwidth and redundancy between switches, routers, and servers. Traffic may be balanced across the physical links using different algorithms. For example, a hashing algorithm may rely on characteristics of a traffic flow, such as source IP address, destination IP address, source MAC address, destination MAC address, etc., to assign a given flow to an interface of a port-channel. Typically, a forwarding engine on a network device running the port-channel supports one hashing algorithm. The algorithm evaluates a hash function, and the forwarding engine routes the channel traffic to the corresponding physical links based on the result.
However, hashing algorithms do not consider available bandwidth as a factor in load balancing traffic. For instance, a hashing algorithm may generate an identical hash result for two different flows. For example, consider a hashing algorithm that calculates an XOR of the source IP address and the destination IP address for each flow. Further, assume a first flow has a source IP address of 1.1.1.1 and a destination IP address of 1.1.1.2. The resulting hash after the XOR operation is 3, which may map to a physical link. However, if a second flow has a source IP address of 2.2.2.1 and a destination IP address of 2.2.2.2, the resulting hash for the second flow is also 3, which maps to the same physical link. As a result, the forwarding engine routes the two flows through the same physical link. Hashing under this algorithm may lead to uneven load sharing, underutilized bandwidth in other links, and dropped packets in the links where percentage utilization has reached 100%. More generally, the performance of an algorithm for assigning flows to interfaces in a port-channel can vary depending on the flows that actually occur.